package com.artPreter.controller;



import com.artPreter.pojo.DepartTemp;
import com.artPreter.pojo.Result;
import com.artPreter.service.IDepartTempService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 艺术机构模板表 前端控制器
 * </p>
 *
 * @author jarvis
 * @since 2024-11-18
 */
@RestController
@RequestMapping("/departTemp")
public class DepartTempController {


    @Autowired
    private IDepartTempService departTempService;

    /**
     * 获取机构模板，如果没有模板则添加一个新模板
     * @param departTemp
     * @return
     */
    @PostMapping("/getDepartTemp")
    public Result<DepartTemp> getDepartTemp(@RequestBody DepartTemp departTemp){
        DepartTemp reulst = departTempService.getDepartTemp(departTemp);
        return Result.success(reulst);
    }

    @PostMapping("/saveDepartTemp")
    public Result saveDepartTemp(@RequestBody DepartTemp departTemp){
        departTempService.saveDepartTemp(departTemp);
        return Result.success();
    }



}
